<style>

  input::-webkit-outer-spin-button,
  input::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
  }

  input[type='number'] {
    -moz-appearance: textfield;
  }


  .avatar-uploader .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }

  .avatar-uploader .el-upload:hover {
    border-color: #673ab7;
  }

  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 300px;
    height: 178px;
    line-height: 178px;
    text-align: center;
  }

  .avatar {
    width: 300px;
    height: 178px;
    display: block;
  }
</style>

<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
      <el-button plain @click="abc(0)">在职{{ statisticsNum.count0 }}人</el-button>&nbsp;&nbsp;&nbsp;
      <el-button type="primary" @click="abc(3)">试用{{ statisticsNum.count1 }}人</el-button>&nbsp;&nbsp;&nbsp;
      <el-button plain @click="abc(4)">正式{{ statisticsNum.count2 }}人</el-button>&nbsp;&nbsp;&nbsp;
      <el-button plain @click="abc(6)">离职{{ statisticsNum.count3 }}人</el-button>&nbsp;&nbsp;&nbsp;

      <el-form-item prop="name">
        <el-input
          v-model="queryParams.all"
          placeholder="请输入搜索内容"
          clearable
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item>
        <el-date-picker
          v-model="queryParams.date"
          type="daterange"
          range-separator="至"
          value-format="yyyy-MM-dd"
          start-placeholder="开始日期"
          end-placeholder="结束日期">
        </el-date-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
        <el-button type="success" icon="el-icon-download" @click="handleExport">导出</el-button>
        <el-button type="success" @click="addEmp">添加员工</el-button>
      </el-form-item>
    </el-form>

    <el-drawer
      title="添加员工"
      :before-close="handleClose"
      :visible.sync="empDrawer"
      direction="rtl"
      custom-class="demo-drawer"
      size="50%"
      ref="drawer"
    >
      <div class="demo-drawer__content">
        <el-form ref="empDraForm" :model="empDraForm" :rules="empDraRules" label-width="120px">
          <el-tag type="success">岗位信息</el-tag>
          <el-row :gutter="24">
            <el-form-item label="选择入职岗位">
              <el-button size="mini" @click="changeStation">选择岗位</el-button>
              <span style="color: blue" v-if="empDraForm.stationId !== undefined">&nbsp;&nbsp; {{empDraForm.stationName}}</span>
              <span style="color: blue" v-if="empDraForm.stationId === undefined"> &nbsp;&nbsp;（未选择岗位）</span>
            </el-form-item>
            <el-dialog :append-to-body="true" title="选择岗位" :visible.sync="statainTable">
              <el-table :data="stationList">
                <el-table-column algin="center" type="index" label="序号" width="50"></el-table-column>
                <el-table-column algin="center" :show-overflow-tooltip="true" property="stationName" label="岗位名称" ></el-table-column>
                <el-table-column algin="center" property="stationCategory" label="岗位类型"></el-table-column>
                <el-table-column algin="center" property="jobGrade" label="岗位等级" ></el-table-column>
                <!--<el-table-column algin="center" :show-overflow-tooltip="true" property="companyName" label="企业名称" ></el-table-column>
                <el-table-column algin="center" property="proName" label="项目组" ></el-table-column>-->
                <el-table-column algin="center" property="createdBy" label="负责商务" ></el-table-column>
                <el-table-column algin="center" width="100"  property="wokeEndTime" label="招聘截至" >
                  <template slot-scope="scope">
                    {{ parseTime(scope.row.wokeEndTime, '{y}-{m}-{d}') }}
                  </template>
                </el-table-column>
                <el-table-column algin="center" width="100"  property="createTime" label="创建时间" >
                  <template slot-scope="scope">
                    {{ parseTime(scope.row.createTime, '{y}-{m}-{d}') }}
                  </template>
                </el-table-column>
                <el-table-column fixed="right" algin="center" width="100"  label="操作" >
                  <template slot-scope="scope">
                    <el-button type="text" @click="selectStation(scope.row)">选择</el-button>
                  </template>
                </el-table-column>
              </el-table>
              <pagination
                v-show="stationTotal>0"
                :total="stationTotal"
                :page.sync="queryStationParams.pageNum"
                :limit.sync="queryStationParams.pageSize"
                @pagination="changeStation"
              />
            </el-dialog>
          </el-row>
          <el-tag type="success">入职信息</el-tag>
          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="入职日期" prop="employmentDate">
                <el-date-picker clearable
                                style="width: 100%"
                                v-model="empDraForm.employmentDate"
                                type="date"
                                placeholder="请选择入职日期">
                </el-date-picker>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="试用期" prop="probationPeriod">
                <el-select v-model="empDraForm.probationPeriod" placeholder="请选择" style="width: 100%">
                  <el-option label="请选择" value=""></el-option>
                  <el-option label="1个月" value="1个月"></el-option>
                  <el-option label="2个月" value="2个月"></el-option>
                  <el-option label="3个月" value="3个月"></el-option>
                  <el-option label="4个月" value="4个月"></el-option>
                  <el-option label="5个月" value="5个月"></el-option>
                  <el-option label="6个月" value="6个月"></el-option>
                </el-select>
              </el-form-item>

            </el-col>
          </el-row>


          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="岗位" prop="positionApplied">
                <el-input v-model="empDraForm.positionApplied" placeholder="请输入"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="职位" prop="title">
                <treeselect @input="parentIdChangeEmp" v-model="empDraForm.title" :options="postOptions" :show-count="true"
                            placeholder="请选择职位"/>
              </el-form-item>
            </el-col>
          </el-row>


          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="工作性质" prop="workNature">
                <el-select v-model="empDraForm.workNature" placeholder="请选择" style="width: 100%">
                  <el-option label="请选择" value=""></el-option>
                  <el-option label="劳务外派" value="劳务外派"></el-option>
                  <el-option label="全职" value="全职"></el-option>
                  <el-option label="兼职" value="兼职"></el-option>
                  <el-option label="外包" value="外包"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="员工状态" prop="status">
                <el-select v-model="empDraForm.status" placeholder="请选择" style="width: 100%">
                  <el-option label="请选择" value=""></el-option>
                  <el-option label="正式" value="4"></el-option>
                  <el-option label="试用" value="3"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>


          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="归属部门" prop="deptName">
                <treeselect @input="parentIdChangeEmp" v-model="empDraForm.deptName" :options="deptOptions"
                            :show-count="true"
                            placeholder="请选择归属部门"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-tag type="success">基本信息</el-tag>
          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="姓名" prop="name">
                <el-input v-model="empDraForm.name" placeholder="请输入"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="性别" prop="gender">
                <el-select v-model="empDraForm.gender" placeholder="请选择性别" style="width: 100%">
                  <el-option label="男" value="男"></el-option>
                  <el-option label="女" value="女"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="年龄" prop="age">
                <el-input v-model="empDraForm.age" placeholder="请输入年龄"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="出生日期" prop="dateOfBirth">
                <el-date-picker clearable
                                style="width: 100%"
                                v-model="empDraForm.dateOfBirth"
                                type="date"
                                placeholder="请选择">
                </el-date-picker>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="是否已婚" prop="isMarriage">
                <el-select v-model="empDraForm.isMarriage" placeholder="请选择" style="width: 100%">
                  <el-option label="未婚" value="未婚"></el-option>
                  <el-option label="已婚" value="已婚"></el-option>
                  <el-option label="离异" value="离异"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="是否生育" prop="isBirth">
                <el-select v-model="empDraForm.isBirth" placeholder="请选择" style="width: 100%">
                  <el-option label="是" value="是"></el-option>
                  <el-option label="否" value="否"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="民族" prop="ethnicGroup">
                <el-input v-model="empDraForm.ethnicGroup" placeholder="请输入民族"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="政治面貌" prop="politicalOutlook">
                <el-input v-model="empDraForm.politicalOutlook" placeholder="请输入"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="证件类型" prop="documentType">
                <el-select v-model="empDraForm.documentType" placeholder="请选择证件类型" style="width: 100%">
                  <el-option label="--请选择--" value=""></el-option>
                  <el-option label="身份证" value="身份证"></el-option>
                  <el-option label="港澳居民来往证明" value="港澳居民来往证明"></el-option>
                  <el-option label="香港身份证" value="香港身份证"></el-option>
                  <el-option label="台湾居民来往大陆通行证" value="台湾居民来往大陆通行证"></el-option>
                  <el-option label="台湾身份证" value="台湾身份证"></el-option>
                  <el-option label="澳门身份证" value="澳门身份证"></el-option>
                  <el-option label="外国护照" value="外国护照"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="证件号码" prop="identificationNumber">
                <el-input v-model="empDraForm.identificationNumber" placeholder="请输入证件号码"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="户籍类型" prop="registeredType">
                <el-select v-model="empDraForm.registeredType" placeholder="请选择户籍类型" style="width: 100%">
                  <el-option label="--请选择--" value=""></el-option>
                  <el-option label="农村户口" value="农村户口"></el-option>
                  <el-option label="城镇户口" value="城镇户口"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="户籍所在地" prop="registeredResidence">
                <el-input v-model="empDraForm.registeredResidence" placeholder="请输入户籍所在地"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-tag type="success">通讯信息</el-tag>

          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="电话" prop="phone">
                <el-input v-model="empDraForm.phone" placeholder="请输入电话号码"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="邮箱" prop="mailbox">
                <el-input v-model="empDraForm.mailbox" placeholder="请输入邮箱"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="紧急联系人" prop="emergencyContact">
                <el-input v-model="empDraForm.emergencyContact" placeholder="请输入紧急联系人"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="紧急联系人电话" prop="emergencyContactNumber">
                <el-input v-model="empDraForm.emergencyContactNumber" placeholder="请输入紧急联系人电话"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="现住址" prop="currentAddress">
                <el-input v-model="empDraForm.currentAddress" placeholder="请输入现住址"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-tag type="success">学历信息</el-tag>

          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="学校名称" prop="schoolName">
                <el-input v-model="empDraForm.schoolName" placeholder="请输入学校名称"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="所学专业" prop="major">
                <el-input v-model="empDraForm.major" placeholder="请输入所学专业"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="学历" prop="education">
                <el-select v-model="empDraForm.education" placeholder="请选择学历" style="width: 100%">
                  <el-option label="请选择" value=""></el-option>
                  <el-option label="不限" value="不限"></el-option>
                  <el-option label="专科" value="大专"></el-option>
                  <el-option label="本科" value="本科"></el-option>
                  <el-option label="硕士" value="硕士"></el-option>
                  <el-option label="博士" value="博士"></el-option>
                </el-select>
              </el-form-item>
            </el-col>
          </el-row>

          <el-tag type="success">工资卡信息</el-tag>

          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="银行名称" prop="bankName">
                <el-input v-model="empDraForm.bankName" placeholder="请输入银行名称"/>
              </el-form-item>
            </el-col>
            <el-col :span="12">
              <el-form-item label="银行卡号" prop="bankCardNo">
                <el-input v-model="empDraForm.bankCardNo" placeholder="请输入银行卡号"/>
              </el-form-item>
            </el-col>
          </el-row>

          <el-row :gutter="24">
            <el-col :span="12">
              <el-form-item label="开户行地址" prop="bankAddress">
                <el-input v-model="empDraForm.bankAddress" placeholder="请输入开户行地址"/>
              </el-form-item>
            </el-col>
          </el-row>
        </el-form>
        <div class="demo-drawer__footer" style="margin-left: 200px">
          <el-button @click="submitEmp" style="width: 200px" type="primary">确定</el-button>
          <el-button @click="closeEmp" style="width: 200px">取 消</el-button>
        </div>
      </div>
    </el-drawer>
    <!--淘汰弹出框 -->
    <el-dialog
      title="提示"
      :visible.sync="dialogVisible"
      width="30%"
    >
      <el-form label-position="right" label-width="80px" :model="leavingForm" :rules="leavingRules" ref="leavingForm">
        <el-form-item prop="leavingReason" label="离职原因">
          <el-select v-model="leavingForm.leavingReason" placeholder="请选择">
            <el-option
              v-for="i in options"
              :key="i.value"
              :label="i.label"
              :value="i.value">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item prop="updateTime" label="离职时间">
          <el-date-picker
            v-model="leavingForm.updateTime"
            type="date"
            value-format="yyyy-MM-dd"
            placeholder="选择日期">
          </el-date-picker>
        </el-form-item>
        <el-form-item prop="remarks" label="备注">
          <el-input
            type="textarea"
            :autosize="{ minRows: 2, maxRows: 4}"
            placeholder="请输入内容"
            style="width: 320px"
            v-model="leavingForm.remarks">
          </el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取 消</el-button>
        <el-button type="primary" @click="handleDeletes()">确 定</el-button>
      </div>
    </el-dialog>

    <el-table v-loading="loading" :data="employeefilesList" @selection-change="handleSelectionChange">
      <el-table-column type="selection" width="55" align="center"/>
      <el-table-column label="姓名" align="center" prop="name"/>
      <el-table-column label="工号" align="center" prop="jobNo"/>
      <el-table-column label="部门" width="120" :show-overflow-tooltip="true" align="center" prop="dname"/>
      <el-table-column label="岗位" width="130" :show-overflow-tooltip="true" align="center" prop="positionApplied"/>
      <el-table-column label="职称" align="center" prop="post"/>
     <!-- <el-table-column label="企业" width="120" :show-overflow-tooltip="true" align="center" prop="enterprise"/>-->
      <el-table-column label="创建人" align="center" prop="uname" width="100"/>
      <el-table-column label="创建日期" align="center" prop="createDate" width="100">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.createDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="到岗日期" align="center" prop="employmentDate" width="100">
        <template slot-scope="scope">
          <span>{{ parseTime(scope.row.employmentDate, '{y}-{m}-{d}') }}</span>
        </template>
      </el-table-column>
      <el-table-column label="工作性质" align="center" prop="workNature"/>
      <el-table-column label="状态" align="center" prop="status">
        <template slot-scope="scope">
          <span v-if="scope.row.status == 3">
            试用
          </span>
        </template>
      </el-table-column>
      <el-table-column label="电话号码" width="120" align="center" prop="phone"/>
      <el-table-column label="操作" width="160" align="center" class-name="small-padding fixed-width" fixed="right">

        <template slot-scope="scope">
          <el-button
            size="mini"
            type="text"
            icon="el-icon-share"
            @click="playVideo(scope.row.id)"

          >查看档案
          </el-button>
          <el-button
            size="mini"
            type="text"
            icon="el-icon-delete"
            @click="dialog(scope.row.id)"
          >办理离职
          </el-button>

        </template>
      </el-table-column>
    </el-table>

    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />

    <!-- 详情对话框 -->
    <el-dialog :title="title" :before-close="closeVideo" :visible.sync="videoVisible" width="90%" append-to-body>

      <el-descriptions class="margin-top" title="" :column="5" size="size" :colon='false' border>
        <el-descriptions-item label="姓名" size="medium"> {{ employeefiles.name }}</el-descriptions-item>
        <el-descriptions-item label="性别">{{ employeefiles.gender }}</el-descriptions-item>
        <el-descriptions-item label="年龄">{{ employeefiles.age }}</el-descriptions-item>
        <el-descriptions-item label="学历">{{ employeefiles.education }}</el-descriptions-item>
        <el-descriptions-item label="电话">{{ employeefiles.phone }}</el-descriptions-item>
        <el-descriptions-item label="到岗日期">{{ employeefiles.employmentDate }}</el-descriptions-item>
        <el-descriptions-item label="岗位">{{ employeefiles.positionApplied }}</el-descriptions-item>
        <!--<el-descriptions-item label="驻场企业">{{ employeefiles.enterprise }}</el-descriptions-item>-->
      </el-descriptions>

      <template>
        <el-tabs v-model="activeName" @tab-click="handleClick">
          <el-tab-pane label="基本信息" name="first">
            <el-button
              size="mini"
              type="text"
              icon="el-icon-edit"
              @click="handleUpdate(employeefiles.id)"
              v-hasPermi="['system:employeefiles:edit']">编辑
            </el-button>
            <el-descriptions title="基本信息">
              <!--                    <el-descriptions-item label="ID">{{ employeefiles.id }}</el-descriptions-item>-->
              <el-descriptions-item label="姓名">{{ employeefiles.name }}</el-descriptions-item>
              <el-descriptions-item label="性别">{{ employeefiles.gender }}</el-descriptions-item>
              <el-descriptions-item label="年龄">{{ employeefiles.age }}</el-descriptions-item>
              <el-descriptions-item label="出生年月">{{ employeefiles.dateOfBirth }}</el-descriptions-item>
              <el-descriptions-item label="是否已婚">{{ employeefiles.isMarriage }}</el-descriptions-item>
              <el-descriptions-item label="是否生育">{{ employeefiles.isBirth }}</el-descriptions-item>
              <el-descriptions-item label="民族">{{ employeefiles.ethnicGroup }}</el-descriptions-item>
              <el-descriptions-item label="政治面貌">{{ employeefiles.politicalOutlook }}</el-descriptions-item>
              <el-descriptions-item label="证件类型">{{ employeefiles.documentType }}</el-descriptions-item>
              <el-descriptions-item label="证件号码">{{ employeefiles.identificationNumber }}</el-descriptions-item>
              <el-descriptions-item label="户籍所在地">{{ employeefiles.registeredResidence }}</el-descriptions-item>
            </el-descriptions>

            <el-descriptions title="通讯信息">
              <el-descriptions-item label="电话">{{ employeefiles.phone }}</el-descriptions-item>
              <el-descriptions-item label="邮箱">{{ employeefiles.mailbox }}</el-descriptions-item>
              <el-descriptions-item label="现住地址">{{ employeefiles.currentAddress }}</el-descriptions-item>
              <el-descriptions-item label="紧急联系人">{{ employeefiles.emergencyContact }}</el-descriptions-item>
              <el-descriptions-item label="紧急联系人电话">{{
                  employeefiles.emergencyContactNumber
                }}
              </el-descriptions-item>
            </el-descriptions>
            <el-descriptions title="学历信息">
              <el-descriptions-item label="学校名称">{{ employeefiles.schoolName }}</el-descriptions-item>
              <el-descriptions-item label="学历">{{ employeefiles.education }}</el-descriptions-item>
              <el-descriptions-item label="所学专业">{{ employeefiles.major }}</el-descriptions-item>
            </el-descriptions>
          </el-tab-pane>
          <el-tab-pane label="工作信息" name="second">
            <el-button
              size="mini"
              type="text"
              icon="el-icon-edit"
              @click="handleUpdate1(employeefiles.id)"
              v-hasPermi="['system:employeefiles:edit']">编辑
            </el-button>
            <el-descriptions title="工作信息">
              <el-descriptions-item label="岗位名称">{{ employeefiles.positionApplied }}</el-descriptions-item>
              <el-descriptions-item label="职位">{{ employeefiles.post }}</el-descriptions-item>
              <el-descriptions-item label="入职时间">{{ employeefiles.employmentDate }}</el-descriptions-item>
              <el-descriptions-item label="试用期">{{ employeefiles.probationPeriod }}</el-descriptions-item>
              <el-descriptions-item label="转正日期">{{
                  parseTime(employeefiles.zzTime, '{y}-{m}-{d}')
                }}
              </el-descriptions-item>
             <!-- <el-descriptions-item label="签约公司">{{ employeefiles.enterprise }}</el-descriptions-item>
              <el-descriptions-item label="驻场企业">{{ employeefiles.enterprise }}</el-descriptions-item>-->
              <el-descriptions-item label="工作地点">{{ employeefiles.wokeAddress }}</el-descriptions-item>
              <el-descriptions-item label="部门">{{ employeefiles.dname }}</el-descriptions-item>
              <el-descriptions-item label="工作性质">{{ employeefiles.workNature }}</el-descriptions-item>
              <el-descriptions-item label="岗位类型">{{ employeefiles.positionType }}</el-descriptions-item>
            </el-descriptions>
          </el-tab-pane>

          <el-tab-pane label="合同信息" name="third">
            <el-table :data="contract" stripe style="width: 100%">
              <el-table-column prop="name" label="姓名" width="180"></el-table-column>
              <el-table-column prop="positionApplied" label="岗位" width="180"></el-table-column>
             <!-- <el-table-column prop="enterPrise" label="驻场企业" width="180"></el-table-column>-->
              <el-table-column prop="type" label="合同类型" width="180"></el-table-column>
              <el-table-column prop="contractStatus" label="合同状态" width="180"></el-table-column>
              <el-table-column prop="contractPeriod" label="合同期限" width="180"></el-table-column>
              <el-table-column prop="auditTime" label="合同签署日期" width="180"></el-table-column>
              <el-table-column prop="endTime" label="合同结束日期" width="180"></el-table-column>
              <el-table-column label="操作" width="150" align="center" class-name="small-padding fixed-width">
                <template slot-scope="scope">
                  <el-button
                    size="mini"
                    type="text"
                    icon="el-icon-s-promotion"
                    @click="downloadTrialPeriod(scope.row.conId)"
                  >合同下载
                  </el-button>
                </template>
              </el-table-column>
            </el-table>
          </el-tab-pane>
          <el-tab-pane label="材料附件" name="fourth">
            <el-form :model="formData" ref="formData">
              <el-form-item prop="empId">
                <el-input type="hidden" v-model="formData.empId"/>
              </el-form-item>
              <el-row :gutter="24">
                <el-col :span="8">
                  <el-form-item label="身份证正面" prop="certificateFront">
                    <el-upload
                      class="avatar-uploader"
                      action="1"
                      :show-file-list="false"
                      :on-success="handleAvatarSuccessFront"

                      :http-request="uploadFront">
                      <img v-if="enclosure.certificateFront"
                           :src="'http://127.0.0.1/'+enclosure.certificateFront" class="avatar">
                      <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                    </el-upload>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="身份证反面" prop="certificateBack">
                    <el-upload
                      class="avatar-uploader"
                      action="1"
                      :show-file-list="false"
                      :on-success="handleAvatarSuccessBack"

                      :http-request="uploadBack">
                      <img v-if="enclosure.certificateBack"
                           :src="'http://127.0.0.1/'+enclosure.certificateBack" class="avatar">
                      <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                    </el-upload>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="毕 业 证" prop="diploma">
                    <el-upload
                      class="avatar-uploader"
                      action="1"
                      :show-file-list="false"
                      :on-success="handleAvatarSuccessDiploma"

                      :http-request="uploadDiploma">
                      <img v-if="enclosure.diploma" :src="'http://127.0.0.1/'+enclosure.diploma"
                           class="avatar">
                      <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                    </el-upload>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="24">
                <el-col :span="8">
                  <el-form-item label="学 位 证" prop="degreesDiploma">
                    <el-upload
                      class="avatar-uploader"
                      action="1"
                      :show-file-list="false"
                      :on-success="handleAvatarSuccessDegreesDiploma"

                      :http-request="uploadDegreesDiploma">
                      <img v-if="enclosure.degreesDiploma" :src="'http://127.0.0.1/'+enclosure.degreesDiploma"
                           class="avatar">
                      <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                    </el-upload>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item label="离职证明" prop="leavingCertificate">
                    <el-upload
                      class="avatar-uploader"
                      action="1"
                      :show-file-list="false"
                      :on-success="handleAvatarSuccessCertificate"

                      :http-request="uploadCertificate">
                      <img v-if="enclosure.leavingCertificate"
                           :src="'http://127.0.0.1/'+enclosure.leavingCertificate" class="avatar">
                      <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                    </el-upload>
                  </el-form-item>
                </el-col>
                <el-col :span="8">
                  <el-form-item prop="examinationReport" label="体检报告">
                    <el-upload
                      class="avatar-uploader"
                      action="1"
                      :show-file-list="false"
                      :on-success="handleAvatarSuccessReport"

                      :http-request="uploadReport">
                      <img v-if="enclosure.examinationReport"
                           :src="'http://127.0.0.1/'+enclosure.examinationReport" class="avatar">
                      <i v-else class="el-icon-plus avatar-uploader-icon"></i>
                    </el-upload>
                  </el-form-item>
                </el-col>
              </el-row>
              <el-row :gutter="24">
                <el-col :span="24">
                  <el-form-item>
                    <el-button type="primary" @click="submitFormData()">提交</el-button>
                  </el-form-item>
                </el-col>
              </el-row>
            </el-form>
          </el-tab-pane>
          <el-tab-pane label="工资社保" name="shebao">
            <el-descriptions class="margin-top" title="工资信息" :column="2" size="size">
              <template slot="extra">
                <el-button
                  size="small"
                  type="text"
                  icon="el-icon-edit"
                  @click="salaryUse()"
                  v-hasPermi="['system:security:updateSalary']">编辑
                </el-button>
              </template>
              <el-descriptions-item label="试用期薪资">{{ itoSecurity.sySalary }}</el-descriptions-item>
              <el-descriptions-item label="转正薪资">{{ itoSecurity.zzSalary }}</el-descriptions-item>
              <el-descriptions-item label="岗位结算价">{{ itoSecurity.gwPrice }}</el-descriptions-item>
              <el-descriptions-item label="试用期结算价">{{ itoSecurity.syPrice }}</el-descriptions-item>
            </el-descriptions>
            <el-descriptions class="margin-top" title="工资卡信息" :column="2" size="size">
              <el-descriptions-item label="银行卡号">{{ employeefiles.bankCardNo }}</el-descriptions-item>
              <el-descriptions-item label="开户行地址">{{ employeefiles.bankAddress }}</el-descriptions-item>
              <el-descriptions-item label="银行名称">{{ employeefiles.bankName }}</el-descriptions-item>
            </el-descriptions>
            <el-descriptions class="margin-top" title="社保信息" :column="2" size="size">
              <template slot="extra">
                <el-button
                  size="small"
                  type="text"
                  icon="el-icon-edit"
                  @click="securityUse()"
                  v-hasPermi="['system:security:updateSalary']">编辑
                </el-button>
              </template>
              <el-descriptions-item label="社保缴纳城市">{{ scheme.schemeCity }}</el-descriptions-item>
              <el-descriptions-item label="参保起始日期">{{ parseTime(scheme.createTime, '{y}-{m}-{d}') }}
              </el-descriptions-item>
              <el-descriptions-item label="是否是首次本地缴纳社保">
                      <span v-if="employeefiles.isFirstSecurity == 0 || employeefiles.isFirstSecurity == null ">
                        否
                      </span>
                <span v-if="employeefiles.isFirstSecurity == 1">
                        是
                      </span>
              </el-descriptions-item>
              <el-descriptions-item label="个人公积金账号">{{ employeefiles.gjNumber }}</el-descriptions-item>
              <el-descriptions-item label="是否是首次本地缴纳公积金">
                      <span
                        v-if="employeefiles.isFirstAccumulationFund == 0 || employeefiles.isFirstAccumulationFund == null ">
                        否
                      </span>
                <span v-if="employeefiles.isFirstAccumulationFund == 1">
                        是
                      </span>
              </el-descriptions-item>
              <el-descriptions-item label="个人社保账号">{{ employeefiles.sbNumber }}</el-descriptions-item>
              <el-descriptions-item label="社保方案" v-if="scheme.schemeName != null">{{ scheme.schemeName }}
                <el-button
                  style="padding-left: 60px"
                  size="medium"
                  type="text"
                  @click="findById"
                >查看
                </el-button>
              </el-descriptions-item>
              <el-descriptions-item label="社保方案" v-if="scheme.schemeName == null">未选择社保方案</el-descriptions-item>


            </el-descriptions>
          </el-tab-pane>
        </el-tabs>
      </template>


    </el-dialog>
    <el-dialog :title="title" :visible.sync="salaryOpen" width="90%" append-to-body>
      <el-form ref="salaryForm" :model="itoSalaryForm" label-width="120px">
        <el-tag type="success">工资信息</el-tag>
        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="银行卡号" prop="name">
              <el-input v-model="itoSalaryForm.cardNumber" placeholder="请输入银行卡号"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="开户行地址" prop="bankAddress">
              <el-input v-model="itoSalaryForm.bankAddress" placeholder="请输入开户行地址"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="银行名称" prop="bankName">
              <el-input v-model="itoSalaryForm.bankName" placeholder="请输入银行名称"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-tag type="success">工资卡信息</el-tag>
        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="试用期薪资" prop="sySalary">
              <el-input v-model="itoSalaryForm.sySalary" placeholder="试用期薪资"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="转正薪资" prop="zzSalary">
              <el-input v-model="itoSalaryForm.zzSalary" placeholder="请输入转正薪资"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="岗位结算价" prop="gwPrice">
              <input type="text" class="el-input__inner" placeholder="请输入转正薪资" v-model.lazy="itoSalaryForm.gwPrice">
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="试用期结算价" prop="syPrice">
              <input type="text" class="el-input__inner" placeholder="请输入转正薪资" v-model.lazy="itoSalaryForm.syPrice">
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col :span="24">
            <el-table :data="empSalary" border
                      :header-cell-style="{background:'#cccccc'}" style="width: 100%">
              <el-table-column align="center" prop="typeName" label="薪资项目"/>
              <el-table-column align="center" prop="periodLater" label="试用期工资"/>
              <el-table-column align="center" prop="memberLater" label="转正工资"/>
            </el-table>
          </el-col>
        </el-row>

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="salaryUpdate">确 定</el-button>
        <el-button @click="salaryCancel">取 消</el-button>
      </div>
    </el-dialog>
    <el-dialog :title="title" :visible.sync="securityOpen" width="90%" append-to-body>
      <el-form ref="securityForm" :model="SecurityFrom" label-width="120px">

        <el-row :gutter="24">
          <el-col :span="10">
            <el-form-item label-width="170px" label="是否是首次本地缴纳社保" prop="isFirstSecurity">
              <el-radio v-model="SecurityFrom.isFirstSecurity" label="1">是</el-radio>
              <el-radio v-model="SecurityFrom.isFirstSecurity" label="0">否</el-radio>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label-width="180px" label="是否是首次本地缴纳公积金" prop="isFirstAccumulationFund">
              <el-radio v-model="SecurityFrom.isFirstAccumulationFund" label="1">是</el-radio>
              <el-radio v-model="SecurityFrom.isFirstAccumulationFund" label="0">否</el-radio>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col :span="10">
            <el-form-item label="个人公积金账号" prop="accumulationFundNum">
              <el-input v-model="SecurityFrom.gjNumber" placeholder="个人公积金账号"/>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="个人社保账号" prop="securityNum">
              <el-input v-model="SecurityFrom.sbNumber" placeholder="请输入个人社保账号"/>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="securityUpdate">确 定</el-button>
        <el-button @click="securityCancel">取 消</el-button>
      </div>
    </el-dialog>
    <el-dialog :title="title" :visible.sync="open" width="75%" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">
        <el-tag type="success">基本信息</el-tag>
        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="姓名" prop="name">
              <el-input v-model="form.name" placeholder="请输入"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="性别" prop="gender">
              <el-select v-model="form.gender" placeholder="请选择性别" style="width: 100%">
                <el-option label="男" value="男"></el-option>
                <el-option label="女" value="女"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="年龄" prop="age">
              <el-input v-model="form.age" placeholder="请输入年龄"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="出生日期" prop="dateOfBirth">
              <el-date-picker clearable
                              style="width: 100%"
                              v-model="form.dateOfBirth"
                              type="date"
                              value-format="yyyy-MM-dd HH:mm:ss"
                              placeholder="请选择">
              </el-date-picker>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="是否已婚" prop="isMarriage">
              <el-select v-model="form.isMarriage" placeholder="请选择" style="width: 100%">
                <el-option label="未婚" value="未婚"></el-option>
                <el-option label="已婚" value="已婚"></el-option>
                <el-option label="离异" value="离异"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="是否生育" prop="isBirth">
              <el-select v-model="form.isBirth" placeholder="请选择" style="width: 100%">
                <el-option label="是" value="是"></el-option>
                <el-option label="否" value="否"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="民族" prop="ethnicGroup">
              <el-input v-model="form.ethnicGroup" placeholder="请输入民族"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="政治面貌" prop="politicalOutlook">
              <el-input v-model="form.politicalOutlook" placeholder="请输入"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="证件类型" prop="documentType">
              <el-select v-model="form.documentType" placeholder="请选择证件类型" style="width: 100%">
                <el-option label="--请选择--" value=""></el-option>
                <el-option label="身份证" value="身份证"></el-option>
                <el-option label="港澳居民来往证明" value="港澳居民来往证明"></el-option>
                <el-option label="香港身份证" value="香港身份证"></el-option>
                <el-option label="台湾居民来往大陆通行证" value="台湾居民来往大陆通行证"></el-option>
                <el-option label="台湾身份证" value="台湾身份证"></el-option>
                <el-option label="澳门身份证" value="澳门身份证"></el-option>
                <el-option label="外国护照" value="外国护照"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="证件号码" prop="identificationNumber">
              <el-input v-model="form.identificationNumber" placeholder="请输入证件号码"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="户籍类型" prop="registeredType">
              <el-select v-model="form.registeredType" placeholder="请选择户籍类型" style="width: 100%">
                <el-option label="--请选择--" value=""></el-option>
                <el-option label="农村户口" value="农村户口"></el-option>
                <el-option label="城镇户口" value="城镇户口"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="户籍所在地" prop="registeredResidence">
              <el-input v-model="form.registeredResidence" placeholder="请输入户籍所在地"/>
            </el-form-item>
          </el-col>
        </el-row>
        <!--        <el-row :gutter="24">
                  <el-col :span="10">
                    <el-form-item label="电话号码" prop="phone">
                      <el-input v-model="form.phone" placeholder="请输入电话号码"/>
                    </el-form-item>
                  </el-col>
                </el-row>
                <el-row :gutter="24">
                  <el-col :span="10">
                    <el-form-item label="邮箱" prop="mailbox">
                      <el-input v-model="form.mailbox" placeholder="请输入邮箱"/>
                    </el-form-item>
                  </el-col>
                  <el-col :span="10">
                    <el-form-item label="现住地址" prop="currentAddress">
                      <el-input v-model="form.currentAddress" placeholder="请输入现住地址"/>
                    </el-form-item>
                  </el-col>
                  <el-col :span="10">
                    <el-form-item label="紧急联系人" prop="emergencyContact">
                      <el-input v-model="form.emergencyContact" placeholder="请输入紧急联系人"/>
                    </el-form-item>
                  </el-col>
                  <el-col :span="10">
                    <el-form-item label="紧急联系人电话" prop="emergencyContactNumber">
                      <el-input v-model="form.emergencyContactNumber" placeholder="请输入紧急联系人电话"/>
                    </el-form-item>
                  </el-col>
                </el-row>-->
        <el-tag type="success">通讯信息</el-tag>

        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="电话" prop="phone">
              <el-input type="number" v-model="form.phone" placeholder="请输入电话号码"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="邮箱" prop="mailbox">
              <el-input v-model="form.mailbox" placeholder="请输入邮箱"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="现住地址" prop="currentAddress">
              <el-input v-model="form.currentAddress" placeholder="请输入现住址"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="紧急联系人" prop="emergencyContact">
              <el-input v-model="form.emergencyContact" placeholder="请输入紧急联系人"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="紧急联系人电话" prop="emergencyContactNumber">
              <el-input type="number" v-model="form.emergencyContactNumber" placeholder="请输入紧急联系人电话"/>
            </el-form-item>
          </el-col>
        </el-row>
        <!--        <el-row :gutter="24">
                  <el-col :span="10">
                    <el-form-item label="学校名称" prop="schoolName">
                      <el-input v-model="form.schoolName" placeholder="请输入学校名称"/>
                    </el-form-item>
                  </el-col>
                  <el-col :span="10">
                    <el-form-item label="学历" prop="education">
                      <el-select v-model="form.education" placeholder="请选择学历">
                        <el-option label="初中" value="初中"></el-option>
                        <el-option label="高中" value="高中"></el-option>
                        <el-option label="中专" value="中专"></el-option>
                        <el-option label="大专" value="大专"></el-option>
                        <el-option label="本科" value="本科"></el-option>
                        <el-option label="硕士" value="硕士"></el-option>
                        <el-option label="博士" value="博士"></el-option>
                      </el-select>
                    </el-form-item>
                  </el-col>
                  <el-col :span="10">
                    <el-form-item label="所学专业" prop="major">
                      <el-input v-model="form.major" placeholder="请输入所学专业"/>
                    </el-form-item>
                  </el-col>
                </el-row>-->
        <el-tag type="success">学历信息</el-tag>

        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="学校名称" prop="schoolName">
              <el-input v-model="form.schoolName" placeholder="请输入学校名称"/>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="所学专业" prop="major">
              <el-input v-model="form.major" placeholder="请输入所学专业"/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row :gutter="24">
          <el-col :span="12">
            <el-form-item label="学历" prop="education">
              <el-select v-model="form.education" placeholder="请选择学历" style="width: 100%">
                <el-option label="请选择" value=""></el-option>
                <el-option label="不限" value="不限"></el-option>
                <el-option label="专科" value="大专"></el-option>
                <el-option label="本科" value="本科"></el-option>
                <el-option label="硕士" value="硕士"></el-option>
                <el-option label="博士" value="博士"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <!--
                <el-form-item label="银行卡号" prop="bankCardNo">
                  <el-input v-model="form.bankCardNo" placeholder="请输入银行卡号" />
                </el-form-item>
                <el-form-item label="开户地址" prop="bankAddress">
                  <el-input v-model="form.bankAddress" placeholder="请输入开户地址" />
                </el-form-item>
                <el-form-item label="银行名称" prop="bankName">
                  <el-input v-model="form.bankName" placeholder="请输入银行名称" />
                </el-form-item>
                <el-form-item label="工号" prop="jobNo">
                  <el-input v-model="form.jobNo" placeholder="请输入工号" />
                </el-form-item>
                <el-form-item label="部门" prop="deptName">
                  <el-input v-model="form.deptName" placeholder="请输入部门" />
                </el-form-item>
                <el-form-item label="职称" prop="title">
                  <el-input v-model="form.title" placeholder="请输入职称" />
                </el-form-item>
                <el-form-item label="入职日期" prop="employmentDate">
                  <el-date-picker clearable
                    v-model="form.employmentDate"
                    type="date"
                    value-format="yyyy-MM-dd"
                    placeholder="请选择入职日期">
                  </el-date-picker>
                </el-form-item>
                <el-form-item label="试用期" prop="probationPeriod">
                  <el-input v-model="form.probationPeriod" placeholder="请输入试用期" />
                </el-form-item>
                <el-form-item label="应聘岗位" prop="positionApplied">
                  <el-input v-model="form.positionApplied" placeholder="请输入应聘岗位" />
                </el-form-item>
                <el-form-item label="企业" prop="enterprise">
                  <el-input v-model="form.enterprise" placeholder="请输入企业" />
                </el-form-item>
                <el-form-item label="入职登记(0,1)" prop="enrollmentRegistration">
                  <el-input v-model="form.enrollmentRegistration" placeholder="请输入入职登记(0,1)" />
                </el-form-item>
                <el-form-item label="合同签署(0,1)" prop="contractSigning">
                  <el-input v-model="form.contractSigning" placeholder="请输入合同签署(0,1)" />
                </el-form-item>
                <el-form-item label="社保定薪(0,1)" prop="socialSecuritySalary">
                  <el-input v-model="form.socialSecuritySalary" placeholder="请输入社保定薪(0,1)" />
                </el-form-item>
                <el-form-item label="逻辑删除" prop="isDelete">
                  <el-input v-model="form.isDelete" placeholder="请输入逻辑删除" />
                </el-form-item>  -->


      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 修改工作信息对话框 -->
    <el-dialog :title="title" :visible.sync="open1" width="900px" append-to-body>
      <el-form ref="form" :model="form" :rules="rules" label-width="120px">

        <el-row :gutter="24">
          <el-col :span="10">
            <el-form-item label="岗位" prop="positionApplied">
              <el-input v-model="form.positionApplied" placeholder="请输入应聘岗位"/>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="职位" prop="title">
              <treeselect @input="parentIdChange" v-model="form.title" :options="postOptions" :show-count="true"
                          placeholder="请选择职位"/>
            </el-form-item>
            <!--            <el-form-item label="职称" prop="title">
                          <el-input v-model="form.title" placeholder="请输入职称"/>
                        </el-form-item>-->
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col :span="10">
            <el-form-item label="入职日期" prop="employmentDate">
              <el-date-picker clearable
                              v-model="form.employmentDate"
                              type="date"
                              value-format="yyyy-MM-dd"
                              placeholder="请选择入职日期">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="试用期" prop="probationPeriod">
              <el-input v-model="form.probationPeriod" placeholder="请输入试用期"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col :span="10">
            <el-form-item label="转正日期" prop="employmentDate">
              <el-date-picker clearable
                              v-model="form.employmentDate"
                              type="date"
                              value-format="yyyy-MM-dd"
                              placeholder="请选择转正日期">
              </el-date-picker>
            </el-form-item>
          </el-col>
          <!--<el-col :span="10">
            <el-form-item label="签约公司" prop="enterprise">
              <el-input v-model="form.enterprise" placeholder="请输入企业"/>
            </el-form-item>
          </el-col>-->
          <el-col :span="10">
            <el-form-item label="工作地点" prop="enterprise">
              <el-input v-model="form.enterprise" placeholder=""/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
         <!-- <el-col :span="10">
            <el-form-item label="驻场企业" prop="enterprise">
              <el-input v-model="form.enterprise" placeholder="请输入企业"/>
            </el-form-item>
          </el-col>-->
        </el-row>
        <el-row :gutter="24">
          <el-col :span="10">
            <el-form-item label="归属部门" prop="deptName">
              <treeselect @input="parentIdChange" v-model="form.deptName" :options="deptOptions" :show-count="true"
                          placeholder="请选择归属部门"/>
            </el-form-item>
          </el-col>
          <el-col :span="10">
            <el-form-item label="工作性质" prop="probationPeriod">
              <el-input v-model="form.workNature" placeholder="请输入工作性质"/>
            </el-form-item>
          </el-col>
        </el-row>
        <el-row :gutter="24">
          <el-col :span="10">
            <el-form-item label="岗位类型" prop="probationPeriod">
              <el-input v-model="form.positionType" placeholder="请输入岗位类型"/>
            </el-form-item>
          </el-col>
        </el-row>

      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitForm">确 定</el-button>
        <el-button @click="cancel">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 详情对话框 -->
    <el-dialog :title="title" :visible.sync="sbopen" width="90%" :close-on-click-modal='false' append-to-body
               border>

      <el-form ref="form" :model="form" :rules="rules" label-width="80px">
        <h1>员工信息</h1>
        <el-divider></el-divider>
        <el-descriptions column="2" title="">
          <el-divider></el-divider>
          <!--                    <el-descriptions-item label="ID">{{ employeefiles.id }}</el-descriptions-item>-->
          <el-descriptions-item label="姓名">{{ form.name }}</el-descriptions-item>

          <el-descriptions-item label="员工状态" v-if="form.status == 3">试用</el-descriptions-item>
          <el-descriptions-item label="员工状态" v-if="form.status == 4">正式</el-descriptions-item>
          <el-descriptions-item label="工号">{{ form.jobNo }}</el-descriptions-item>
          <el-descriptions-item label="入职日期">{{ form.employmentDate }}</el-descriptions-item>
          <el-descriptions-item label="证件类型">{{ form.documentType }}</el-descriptions-item>
          <el-descriptions-item label="证件号码">{{ form.identificationNumber }}</el-descriptions-item>
          <el-descriptions-item label="个人社保号">{{ form.sbNumber }}</el-descriptions-item>
          <el-descriptions-item label="个人公积金号">{{ form.gjNumber }}</el-descriptions-item>
        </el-descriptions>
        <h1>参保信息</h1>
        <el-divider></el-divider>
        <el-descriptions column="2" title="">
          <el-divider></el-divider>
          <!--                    <el-descriptions-item label="ID">{{ employeefiles.id }}</el-descriptions-item>-->
          <el-descriptions-item label="方案名称">{{ form.schemeName }}</el-descriptions-item>
          <el-descriptions-item label="参保平台">{{ form.schemePlatform }}</el-descriptions-item>
          <el-descriptions-item label="参保城市">{{ form.schemeCity }}</el-descriptions-item>

        </el-descriptions>
        <h1>社保</h1>
        <el-divider></el-divider>
        <table border="1" cellspacing="1" cellpadding="0" bordercolor="#87cefa">
          <tr bgcolor="#87cefa">
            <td colspan="4" height="40" align="center">个人缴纳</td>
            <td colspan="4" height="40" align="center">企业缴纳</td>
          </tr>
          <tr bgcolor="#87cefa">
            <td width="11%" height="40" align="center">缴费项目</td>
            <td width="11%" height="40" align="center">基数</td>
            <td width="11%" height="40" align="center">缴费比例</td>
            <td width="11%" height="40" align="center">金额</td>
            <td width="11%" height="40" align="center">基数</td>
            <td width="11%" height="40" align="center">缴费比例</td>
            <td width="11%" height="40" align="center">金额</td>
            <td width="11%" height="40" align="center">小计</td>
          </tr>
          <tr>
            <td align="center">养老保险</td>
            <td>
              <el-input :disabled="true" v-model="form.grYlBase" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.grYlProportion" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.grYlMoney" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.companyYlBase" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.companyYlProportion" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.companyYlMoney" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.ylInsuranceMoney" placeholder="00.00"/>
            </td>
          </tr>
          <tr>
            <td align="center">工商保险</td>
            <td>
              <el-input :disabled="true" v-model="form.grGsBase" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.grGsProportion" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.grGsMoney" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.companyGsBase" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.companyGsProportion" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.companyGsMoney" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.gsInsuranceMoney" placeholder="00.00"/>
            </td>
          </tr>
          <tr>
            <td align="center">失业保险</td>
            <td>
              <el-input :disabled="true" v-model="form.grSyBase" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.grSyProportion" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.grSyMoney" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.companySyBase" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.companySyProportion" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.companySyMoney" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.syInsuranceMoney" placeholder="00.00"/>
            </td>
          </tr>
          <tr>
            <td align="center">生育保险</td>
            <td>
              <el-input :disabled="true" v-model="form.grBirthBase" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.grBirthProportion" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.grBirthMoney" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.companyBirthBase" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.companyBirthProportion" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.companyBirthMoney" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.birthInsuranceMoney" placeholder="00.00"/>
            </td>
          </tr>
          <tr>
            <td align="center">医疗保险</td>
            <td>
              <el-input :disabled="true" v-model="form.grCareBase" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.grCareProportion" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.grCareMoney" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.companyCareBase" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.companyCareProportion" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.companyCareMoney" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.careInsuranceMoney" placeholder="00.00"/>
            </td>
          </tr>
          <tr>
            <td></td>
            <td align="center" colspan="3">个人缴纳：<input :disabled="true" v-model="form.grInsuranceMoney"
                                                       placeholder="00.00"/></td>
            <td align="center" colspan="3">公司缴纳：<input :disabled="true" v-model="form.companyInsuranceMoney"
                                                       placeholder="00.00"/></td>
            <td>合计：<input :disabled="true" v-model="form.insuranceMoney" placeholder="00.00"/></td>
          </tr>
        </table>
        <h1>公积金</h1>
        <el-divider></el-divider>
        <table border="1" cellspacing="1" cellpadding="0" bordercolor="#87cefa">
          <tr bgcolor="#87cefa">
            <td colspan="4" height="40" align="center">个人缴纳</td>
            <td colspan="4" height="40" align="center">企业缴纳</td>
          </tr>
          <tr bgcolor="#87cefa">
            <td height="40" width="11%" align="center">缴费项目</td>
            <td height="40" width="11%" align="center">基数</td>
            <td height="40" width="11%" align="center">缴费比例</td>
            <td height="40" width="11%" align="center">金额</td>
            <td height="40" width="11%" align="center">基数</td>
            <td height="40" width="11%" align="center">缴费比例</td>
            <td height="40" width="11%" align="center">金额</td>
            <td height="40" width="11%" align="center">小计</td>
          </tr>
          <tr>
            <td align="center">公积金</td>
            <td>
              <el-input :disabled="true" v-model="form.grFundBase" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.grFundProportion" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.grFundMoney" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.companyFundBase" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.companyFundProportion" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.companyFundMoney" placeholder="00.00"/>
            </td>
            <td>
              <el-input :disabled="true" v-model="form.fundSubtotal" placeholder="00.00"/>
            </td>
          </tr>

          <tr>
            <td></td>
            <td align="center" colspan="3">个人缴纳：<input :disabled="true" v-model="form.grFundPayment"
                                                       placeholder="00.00"/></td>
            <td align="center" colspan="3">公司缴纳：<input :disabled="true" v-model="form.companyFundPayment"
                                                       placeholder="00.00"/></td>
            <td>合计：<input :disabled="true" v-model="form.fundTotal" placeholder="00.00"/></td>
          </tr>
        </table>
      </el-form>
    </el-dialog>
  </div>
</template>

<script>
import {
  beforeAvatarUpload,
  addEnclosure,
  getContract,
  statisticsNum,
  giveUp,
  getEidByCid,
  listContract,
  listRoster,
  getEmployeefiles,
  delEmployeefiles,
  addEmployeefiles,
  updateEmployeefiles,
  upload, insertEmpForm
} from "@/api/system/employeefiles";
  import {getEnclosure, updateEnclosure} from '@/api/system/enclosure';
  import {
    selectSecurityById,
    updateSalary,
    selectById,
    updateSecurity
  } from '@/api/system/security';
  import {rzdxAdd, rzdxfindById} from '@/api/system/Management';
  import {deptTreeSelect} from "@/api/system/user"
  import {postTreeSelect} from '@/api/system/org'
  import Treeselect from '@riophae/vue-treeselect'
  import "@riophae/vue-treeselect/dist/vue-treeselect.css"
  import {getScheme} from '@/api/system/scheme'
  import {TextToCode} from 'element-china-area-data'
  import {getEmpSalaryListByEmpId} from "@/api/system/employeeSalary";
  import Template from "@/views/system/email/ItoTemplate.vue";
import {listStation} from "@/api/system/delivery";


  export default {
    components: {Template, Treeselect},
    name: "Employeefiles",
    data() {
      return {
        id: null,
        sbopen: null,
        postOptions: undefined,
        deptOptions: undefined,
        securityOpen: false,
        itoSecurityFrom: {
          securityAddress: null,
          securityStartTime: null,
          isFirstSecurity: '0',
          accumulationFundNum: null,
          isFirstAccumulationFund: '0',
          securityNum: null,
          saId: 0,
          proId: 0,
        },
        SecurityFrom: {
          id: 0,

          isFirstSecurity: '0',

          isFirstAccumulationFund: '0',
          sbNumber: null,
          gjNumber: null
        },
        itoSecurity: {
          id: null,
          securityAddress: null,
          securityStartTime: null,
          isFirstSecurity: null,
          accumulationFundNum: null,
          isFirstAccumulationFund: null,
          securityNum: null,
          eid: null,
          proId: null,
          projectName: null,
          cardNumber: null,
          bankAddress: null,
          bankName: null,
          sySalary: null,
          zzSalary: null
        },
        itoSalaryForm: {
          eid: null,
          cardNumber: null,
          bankAddress: null,
          bankName: null,
          sySalary: null,
          zzSalary: null
        },
        salaryOpen: false,
        formData: {
          certificateFront: null,
          certificateBack: null,
          diploma: null,
          degreesDiploma: null,
          leavingCertificate: null,
          examinationReport: null,
          empId: null
        },
        empSalary:[],
        enclosure: {
          certificateFront: '',
          certificateBack: '',
          diploma: '',
          degreesDiploma: '',
          leavingCertificate: '',
          examinationReport: '',
          empId: null
        },
        activeName: 'first',
        // 遮罩层
        loading: true,
        emp: {},
        scheme: {},
        loadingContract: true,
        // 选中数组
        ids: [],
        // 非单个禁用
        single: true,
        // 非多个禁用
        multiple: true,
        // 显示搜索条件
        showSearch: true,
        // 总条数
        total: 0,
        statisticsNum: {
          count0: 0,
          count1: 0,
          count2: 0,
          count3: 0
        },
        totalContract: 0,
        // 合同表格数据
        contract: [],

        // 员工档案表格数据
        employeefilesList: [],
        employeefiles: {
          id: null,
          name: null,
          gender: null,
          age: null,
          dateOfBirth: null,
          isMarriage: null,
          isBirth: null,
          ethnicGroup: null,
          politicalOutlook: null,
          documentType: null,
          identificationNumber: null,
          registeredResidence: null,
          phone: null,
          mailbox: null,
          currentAddress: null,
          emergencyContact: null,
          emergencyContactNumber: null,
          schoolName: null,
          education: null,
          major: null,
          bankCardNo: null,
          bankAddress: null,
          bankName: null,
          jobNo: null,
          deptName: null,
          title: null,
          workNature: null,
          employmentDate: null,
          probationPeriod: null,
          positionApplied: null,
          positionType: null,
          enterprise: null,
          status: null,
          enrollmentRegistration: null,
          contractSigning: null,
          socialSecuritySalary: null,
          isDelete: null,
        },
        contractList: {
          pageNum: 1,
          pageSize: 10,
          enterPrise: null,
          conId: null,
          id: null,
          name: null,
          filePath: null,
          stationName: null,
          contractNo: null,
          residentEnterprises: null,
          staffStatus: null,
          type: null,
          contractStatus: null,
          contractPeriod: null,
          auditTime: null,
          endTime: null,
          createBy: null,
          updateBy: null,
          isContract: null,
          signingTimes: null,
          beginTime: null,
          endTimee: null,
          isDelete: null,
        },
        // 弹出层标题
        title: "",
        // 是否显示弹出层
        open: false,
        open1: false,
        dialogVisible: false,
        videoVisible: false,
        options: [{
          value: '',
          label: '请选择'
        }, {
          value: '个人原因',
          label: '个人原因'
        }, {
          value: '合同到期',
          label: '合同到期'
        }, {
          value: '职业发展',
          label: '职业发展'
        }, {
          value: '试用期未通过',
          label: '试用期未通过'
        }, {
          value: '其他',
          label: '其他'
        }],
        leavingForm: {
          leavingReason: null,
        },
        leavingRules: {
          leavingReason: [
            {required: true, message: '离职原因不能为空', trigger: 'change'}
          ],
          updateTime:[
            { required: true, message: '请选择离职日期', trigger: 'change' }
          ]
        },
        // 查询参数
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          name: null,
          gender: null,
          age: null,
          dateOfBirth: null,
          isMarriage: null,
          isBirth: null,
          ethnicGroup: null,
          politicalOutlook: null,
          documentType: null,
          identificationNumber: null,
          registeredResidence: null,
          phone: null,
          mailbox: null,
          currentAddress: null,
          emergencyContact: null,
          emergencyContactNumber: null,
          schoolName: null,
          education: null,
          major: null,
          bankCardNo: null,
          bankAddress: null,
          bankName: null,
          jobNo: null,
          deptName: null,
          title: null,
          workNature: null,
          employmentDate: null,
          probationPeriod: null,
          positionApplied: null,
          positionType: null,
          enterprise: null,
          status: null,
          enrollmentRegistration: null,
          contractSigning: null,
          socialSecuritySalary: null,
          isDelete: null,
          all: null,
        },
        queryParamsContract: {
          pageNum: 1,
          pageSize: 10,
          name: null,
          stationName: null,
          contractNo: null,
          residentEnterprises: null,
          staffStatus: null,
          type: null,
          contractStatus: null,
          contractPeriod: null,
          auditTime: null,
          endTime: null,
          createBy: null,
          updateBy: null,
          isContract: null,
          signingTimes: null,
          beginTime: null,
          endTimee: null,
          isDelete: null
        },
        // 表单参数
        form: {},
        // 表单校验
        rules: {},
        queryStationParams:{
          pageNum: 1,
          pageSize: 10,
          isDelete: '0'
        },
        stationList:[],
        stationTotal:0,
        statainTable:false,
        empDraForm: {},
        empDraRules: {
          employmentDate: [
            {required: true, message: '入职日期不能为空', trigger: 'blur'}
          ],
          probationPeriod: [
            {required: true, message: '试用期不能为空', trigger: 'change'}
          ],
          positionApplied: [
            {required: true, message: '岗位不能为空', trigger: 'blur'}
          ],
          title: [
            {required: true, message: '职位不能为空', trigger: 'blur'}
          ],
          workNature: [
            {required: true, message: '工作性质不能为空', trigger: 'change'}
          ],
          status: [
            {required: true, message: '员工状态不能为空', trigger: 'change'}
          ],
          deptName: [
            {required: true, message: '组织部门不能为空', trigger: 'change'}
          ],
          name: [
            {required: true, message: '姓名不能为空', trigger: 'blur'}
          ],
          age: [
            {required: true, message: '年龄不能为空', trigger: 'blur'}
          ],
        },
        empDrawer: false
      };
    },
    created() {
      this.getPostTree();
      this.getDeptTree();
      this.getList();
      this.getListContract();
      this.statistics();
    },
    methods: {
      submitEmp(){
        if (this.empDraForm.stationId !== undefined && this.empDraForm.stationId !== null){
          this.$refs["empDraForm"].validate(valid => {
            if (valid) {
              insertEmpForm(this.empDraForm).then(res =>{
                this.empDrawer = false
                this.getList();
                this.statistics();
                this.$message({
                  message: '添加成功',
                  type: 'success'
                });
              })
            }
          })
        }else {
          this.$message({
            message: '请选择入职岗位',
            type: 'warning'
          });
        }
      },
      closeEmp(){
        this.empDraForm = {}
      },
      selectStation(row){
        this.empDraForm.stationId = row.stationId
        this.empDraForm.stationName = row.stationName
        this.empDraForm.positionApplied = row.stationName
        this.empDraForm.stationCategory = row.stationCategory
        this.empDraForm.companyName = row.companyName
        this.statainTable = false
      },
      changeStation() {
        this.loading = true;
        listStation(this.queryStationParams).then(response => {
          this.stationList = response.rows;
          this.stationTotal = response.total
          this.statainTable = true
        });
        this.loading = false;
      },
      addEmp() {
        this.empDrawer = true
      },
      handleClose() {
        this.empDrawer = false
        this.empDraForm = {}
      },
      parentIdChangeEmp(){
        this.$nextTick(() => {
          this.$refs.empDraForm.validateField('deptName')
        })
      },
      closeVideo(){
        this.videoVisible = false
        this.employeefiles = {}
        this.contract = []
        this.formData = {}
        this.itoSecurity = {}
        this.scheme = {}
        this.enclosure = {}
      },
      downloadTrialPeriod(conId) {
        this.$download.hetzip(conId)
      },
      securityUse() {
        this.title = '编辑';
        getEmployeefiles(this.employeefiles.id).then(resp => {
          this.SecurityFrom = resp.data;

          if (resp.data.isFirstSecurity === undefined || resp.data.isFirstSecurity === null) {
            this.SecurityFrom.isFirstSecurity = '0'
          } else {
            if (resp.data.isFirstSecurity === 0) {
              this.SecurityFrom.isFirstSecurity = '0'
            } else if (resp.data.isFirstSecurity === 1) {
              this.SecurityFrom.isFirstSecurity = '1'
            }
          }
          if (resp.data.isFirstAccumulationFund === undefined || resp.data.isFirstAccumulationFund === null) {
            this.SecurityFrom.isFirstAccumulationFund = '0'
          } else {
            if (resp.data.isFirstAccumulationFund === 0) {
              this.SecurityFrom.isFirstAccumulationFund = '0'
            } else if (resp.data.isFirstAccumulationFund === 1) {
              this.SecurityFrom.isFirstAccumulationFund = '1'
            }
          }
        })
        this.securityOpen = true;
      },
      securityUpdate() {
        updateEmployeefiles(this.SecurityFrom).then(resp => {
          this.securityOpen = false;
          this.$modal.msgSuccess("修改成功");
          this.playVideo(this.employeefiles.id)
          this.SecurityFrom = {}
        })
      },
      securityCancel() {
        this.securityOpen = false;
      },
      salaryCancel() {
        this.salaryOpen = false;
      },
      salaryUse() {
        this.title = '编辑';
        rzdxfindById(this.employeefiles.id).then(resp => {

          this.itoSalaryForm = resp.data;
        })
        getEmpSalaryListByEmpId(this.employeefiles.id).then(res => {
          this.empSalary = res.data
        })
        this.salaryOpen = true
      },
      salaryUpdate() {
        if (this.itoSecurity.id == null || this.itoSecurity.id == 0) {
          this.itoSalaryForm.eid = this.id
          rzdxAdd(this.itoSalaryForm).then(response => {
            this.emp.id = this.id;
            this.emp.isSalary = 1;
            updateEmployeefiles(this.emp).then(response => {
            });
            this.salaryOpen = false;
            this.$modal.msgSuccess("修改成功");
            this.playVideo(this.itoSalaryForm.eid)
            this.itoSalaryForm = {}
          });
        } else {
          updateSalary(this.itoSalaryForm).then(resp => {
            this.salaryOpen = false;
            this.$modal.msgSuccess("修改成功");
            this.playVideo(this.itoSalaryForm.eid)
            this.itoSalaryForm = {}
          })
        }
      },
      closeEnclosure() {
        this.itoSecurityFrom = {}
        this.itoSalaryForm = {}
        this.formData = {}
        this.enclosure = {}
        this.itoSecurity = {}
        this.videoVisible = false;
      },
      uploadFront(file) {
        var formdata = new FormData();
        formdata.append("file", file.file);
        upload(formdata).then((res) => {
          this.enclosure.certificateFront = res.msg;
          this.formData.certificateFront = res.msg;

        });
      },
      handleAvatarSuccessFront(res, file) {
        this.formData.certificateFront = URL.createObjectURL(file.raw);
      },
      uploadBack(file) {
        var formdata = new FormData();
        formdata.append("file", file.file);
        upload(formdata).then((res) => {
          this.enclosure.certificateBack = res.msg;
          this.formData.certificateBack = res.msg;

        });
      },
      handleAvatarSuccessBack(res, file) {
        this.formData.certificateBack = URL.createObjectURL(file.raw);
      },
      uploadDiploma(file) {
        var formdata = new FormData();
        formdata.append("file", file.file);
        upload(formdata).then((res) => {
          this.formData.diploma = res.msg;

        });
      },
      handleAvatarSuccessDiploma(res, file) {
        this.formData.diploma = URL.createObjectURL(file.raw);
      },
      uploadDegreesDiploma(file) {
        var formdata = new FormData();
        formdata.append("file", file.file);

        upload(formdata).then((res) => {
          this.formData.degreesDiploma = res.msg;

        });
      },
      handleAvatarSuccessDegreesDiploma(res, file) {
        this.formData.degreesDiploma = URL.createObjectURL(file.raw);
      },
      uploadCertificate(file) {
        var formdata = new FormData();
        formdata.append("file", file.file);

        upload(formdata).then((res) => {
          this.formData.leavingCertificate = res.msg;

        });
      },
      handleAvatarSuccessCertificate(res, file) {
        this.formData.leavingCertificate = URL.createObjectURL(file.raw);
      },
      uploadReport(file) {
        var formdata = new FormData();
        formdata.append("file", file.file);
        upload(formdata).then((res) => {
          this.formData.examinationReport = res.msg;

        });
      },
      handleAvatarSuccessReport(res, file) {
        this.formData.examinationReport = URL.createObjectURL(file.raw);
      },
      beforeAvatarUpload(file) {
        const isJPG = file.type === 'image/jpeg' || file.type === 'image/png';
        const isLt2M = file.size / 1024 / 1024 < 2;

        if (!isJPG) {
          this.$message.error('上传图片只能是 JPG/PNG 格式!');
        }
        if (!isLt2M) {
          this.$message.error('上传图片大小不能超过 2MB!');
        }
        return isJPG && isLt2M;
      },
      submitFormData() {

        this.$refs["formData"].validate(valid => {
          if (valid) {
            this.formData.empId = this.employeefiles.id
            if (this.enclosure.empId != null) {
              updateEnclosure(this.formData).then(response => {
                this.$modal.msgSuccess("修改成功");
                this.videoVisible = false;
              });
            } else {
              addEnclosure(this.formData).then(resp => {
                this.$modal.msgSuccess("新增成功");
                this.videoVisible = false;
              })
            }
          }
        });
      },
      handleClick(tab, event) {
      },

      abc(s) {
        var path = null;
        if (s == 0) {
          path = 'roster'
        }
        if (s == 3) {
          path = 'rostertrial'
        }
        if (s == 4) {
          path = 'rosterformal'
        }
        if (s == 6) {
          path = 'rosterquit'
        }
        this.$router.push({path: '/employeefiles/1/' + path}).catch(() => {
        })
      },

      /** 查询合同管理列表 */
      getListContract() {
        this.loadingContract = true;
        listContract(this.queryParamsContract).then(response => {
          this.contractList = response.rows;
          this.totalContract = response.totalContract;
          this.loadingContract = false;
        });
      },

      /** 查询员工档案列表 */
      getList() {
        this.loading = true;
        listRoster(this.queryParams).then(response => {
          this.employeefilesList = response.rows;
          this.total = response.total;
        });
        this.loading = false;
      },
      /** 统计数量 */
      statistics() {
        statisticsNum().then(response => {
          if (response.data !== undefined) {
            this.statisticsNum = response.data;
          }
        });
      },
      /**办理离职按钮 **/
      dialog(id) {
        this.id = id;
        this.dialogVisible = true;
      },
      // 取消按钮
      cancel() {
        this.open = false;
        this.open1 = false;
        this.reset();
      },
      // 表单重置
      reset() {
        this.form = {
          id: null,
          name: null,
          gender: null,
          age: null,
          dateOfBirth: null,
          isMarriage: null,
          isBirth: null,
          ethnicGroup: null,
          politicalOutlook: null,
          documentType: null,
          identificationNumber: null,
          registeredResidence: null,
          phone: null,
          mailbox: null,
          currentAddress: null,
          emergencyContact: null,
          emergencyContactNumber: null,
          schoolName: null,
          education: null,
          major: null,
          bankCardNo: null,
          bankAddress: null,
          bankName: null,
          jobNo: null,
          deptName: null,
          title: null,
          workNature: null,
          employmentDate: null,
          probationPeriod: null,
          positionApplied: null,
          positionType: null,
          enterprise: null,
          status: 0,
          enrollmentRegistration: null,
          contractSigning: null,
          socialSecuritySalary: null,
          isDelete: null,
          createTime: null,
          updateTime: null
        };
        this.resetForm("form");
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.queryParams = {
          pageNum: 1,
          pageSize: 10,
          name: null,
          gender: null,
          age: null,
          dateOfBirth: null,
          isMarriage: null,
          isBirth: null,
          ethnicGroup: null,
          politicalOutlook: null,
          documentType: null,
          identificationNumber: null,
          registeredResidence: null,
          phone: null,
          mailbox: null,
          currentAddress: null,
          emergencyContact: null,
          emergencyContactNumber: null,
          schoolName: null,
          education: null,
          major: null,
          bankCardNo: null,
          bankAddress: null,
          bankName: null,
          jobNo: null,
          deptName: null,
          title: null,
          workNature: null,
          employmentDate: null,
          probationPeriod: null,
          positionApplied: null,
          positionType: null,
          enterprise: null,
          status: null,
          enrollmentRegistration: null,
          contractSigning: null,
          socialSecuritySalary: null,
          isDelete: null,
          query: null,
        }
        this.resetForm("queryForm");
        this.handleQuery();
      },
      // 多选框选中数据
      handleSelectionChange(selection) {
        this.ids = selection.map(item => item.id)
        this.single = selection.length !== 1
        this.multiple = !selection.length
      },
      /** 新增按钮操作 */
      handleAdd() {
        this.reset();
        this.open = true;
        this.title = "编辑";
      },
      /** 修改按钮操作 */
      handleUpdate(id) {
        this.reset();
        const id1 = id || this.ids
        getEmployeefiles(id1).then(response => {
          this.form = response.data;
          this.open = true;
          this.title = "编辑";
        });
      },
      /** 修改按钮操作 */
      handleUpdate1(id) {
        this.reset();
        const id1 = id || this.ids
        getEmployeefiles(id1).then(response => {
          this.form = response.data;
          this.open1 = true;
          this.title = "编辑";
        });
      },
      handleUpload(certificateFront) {
        upload(id1).then(response => {

        });
      },
      /** 提交按钮 */
      submitForm() {
        this.$refs["form"].validate(valid => {
          if (valid) {
            if (this.form.id != null) {
              updateEmployeefiles(this.form).then(response => {
                this.$modal.msgSuccess("修改成功");
                this.playVideo(this.employeefiles.id)
                this.open = false;
                this.open1 = false;
                this.getList();
              });
            } else {
              addEmployeefiles(this.form).then(response => {
                this.$modal.msgSuccess("新增成功");
                this.playVideo(this.employeefiles.id)
                this.open = false;
                this.getList();
              });
            }
          }
        });
      },
      /** 删除按钮操作 */
      handleDelete(row) {
        const ids = row.id || this.ids;
        this.$modal.confirm('是否确认删除员工档案编号为"' + ids + '"的数据项？').then(function () {
          return delEmployeefiles(ids);
        }).then(() => {
          this.getList();
          this.$modal.msgSuccess("删除成功");
        }).catch(() => {
        });
      },
      /** 查看档案按钮操作 */
      playVideo(id) {
        this.id = id
        getEmployeefiles(id).then(response => {
          this.employeefiles = response.data;
          this.videoVisible = true
          if (this.employeefiles.sid != null) {
            getScheme(this.employeefiles.sid).then(resp => {
              this.scheme = response.data;

            });
          } else {
            this.scheme = {};
          }
        });
        getContract(id).then(response => {
          this.contract = response.data;
          this.totalContract = response.totalContract;
        });
        getEnclosure(id).then(res => {
          if (res.data != null) {
            this.formData = res.data;
            this.enclosure = res.data;
          }
        });
        selectSecurityById(id).then(resp => {
          if (resp != null && resp.data != null) {
            this.itoSecurity = resp.data;
          }
        })
      },
      /**淘汰按钮 **/
      handleDeletes() {
        this.$refs["leavingForm"].validate(valid => {
          if (valid) {
            var id = this.id;
            var leavingReason = this.leavingForm.leavingReason;
            var remarks = this.leavingForm.remarks;
            giveUp(id, leavingReason,remarks,this.leavingForm.updateTime).then(response => {
              this.dialogVisible = false;
              this.$modal.msgSuccess("操作成功");
              this.getList();
              this.statistics();
            });
          }
        })
      },
      guanbi() {
        this.videoVisible = false;
        this.certificateFront = null,
          this.certificateBack = null,
          this.diploma = null,
          this.degreesDiploma = null,
          this.leavingCertificate = null
        this.examinationReport = null
      },
      saveFn() {
        this.fromImg.certificateFront = this.certificateFront
        this.fromImg.certificateBack = this.certificateBack
        this.fromImg.diploma = this.diploma
        this.fromImg.degreesDiploma = this.degreesDiploma
        this.fromImg.leavingCertificate = this.leavingCertificate
        this.fromImg.examinationReport = this.examinationReport
        addEnclosure(this.fromImg).then(response => {
          this.videoVisible = false;
          this.certificateFront = null,
            this.certificateBack = null,
            this.diploma = null,
            this.degreesDiploma = null,
            this.leavingCertificate = null
          this.examinationReport = null
        });
      },
      /** 导出按钮操作 */
      handleExport() {
        this.download('system/employeefiles/exportTrialPeriod', {
          ...this.queryParams
        }, `员工花名册-试用${new Date().getTime()}.xlsx`)
      },
      parentIdChange() {
        this.$nextTick(() => {
          this.$refs.form.validateField('deptName')
        })
      },
      /** 查询部门下拉树结构 */
      getDeptTree() {
        deptTreeSelect().then(response => {

          this.deptOptions = response.data;
        });
      },
      /** 查询职位下拉树结构 */
      getPostTree() {
        postTreeSelect().then(response => {

          this.postOptions = response.data;
        });
      },
      findById() {


        var id = this.id
        getEmployeefiles(id).then(response => {

          this.form = response.data;
          var addressStr = new Array(); //定义一数组
          addressStr = (this.form.schemeCity).split("/"); //字符分割
          this.selectedAddressOptions = TextToCode[addressStr[0]][addressStr[1]][addressStr[2]].code;

          this.sbopen = true;
          this.title = "详情";
        });
      },
    }
  };
</script>
